package com.gt.stream

import org.apache.spark.SparkConf
import org.apache.spark.rdd.RDD
import org.apache.spark.streaming.dstream.{DStream, InputDStream}
import org.apache.spark.streaming.{Durations, StreamingContext}

import scala.collection.mutable

/**
 * 自定义数据源
 */
object Streaming_WC_DIY_01 {

  def main(args: Array[String]): Unit = {

    //1. 创建上下文对象
    val conf: SparkConf = new SparkConf().setAppName("xx").setMaster("local[*]")
    val ssc = new StreamingContext(conf, Durations.seconds(1))


    //6. 启动任务
    ssc.start()
    ssc.awaitTermination()
  }

}
